home *** CD-ROM | disk | FTP | other *** search
- Path: ohstpy.mps.ohio-state.edu!vancleef
- From: vancleef@ohstpy.mps.ohio-state.edu
- Newsgroups: comp.lang.c
- Subject: Re: HP UX 10.0 C programming
- Message-ID: <1996Jan4.021743.8654@ohstpy>
- Date: 4 Jan 96 02:17:43 -0500
- References: <4cfje3$qk@nn.fast.net>
- Organization: The Ohio State University, Department of Physics
-
- In article <4cfje3$qk@nn.fast.net>, "Chad R. Laity" <wick@pop.fast.net> writes:
- > 2 questions: (1) What is a good book for HP UX 10.0 C programming?
- > (2) Why do I get an error on this cut down program listed
- > below when I compile it on an HP 9000 K200 with HP UX 10.0
- > and I do not get an error with our Intergraph server?
- > (basically I just want to get the file size of a file but
- > this buf problem is giving me a head ache)
- > ----------------------- program ---------------------------------
- >
- > #include <stdio.h>
- > #include <sys/stat.h>
- >
- > main()
- > {
- > int i;
- > int stat(const char *path, struct stat *buf);
- >
- > i = stat("/usr2/test/testfile", &buf); /* line 15 */
- >
- > }
- >
- > ------------------------ error -----------------------------------
- > Compiled using: cc -Aa test.c
- >
- > cc: "test.c", line 15: error 1588: "buf" undefined.
- > cc: "test.c", line 15: warning 563: Argument #2 is not the correct type.
-
- Prototypes don't do inside functions. Also it would help
- if you defined what buf was:
-
- int stat(const char *path, struct stat *buf);
-
- main()
- {
- struct stat buf;
-
- ...
-
- }
-
- -Garrett
-
-
- >
-